<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
String contextPath=request.getContextPath();
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+contextPath;
pageContext.setAttribute("basePath",basePath);
request.setAttribute("contextPath", contextPath);
%>
<html lang="en">
<head>
<meta charset="utf-8">
<title>慧驾书城后台管理系统</title>
<meta name="查看port" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- Bootstrap style -->
<link id="callCss" rel="stylesheet"
	href="${contextPath }/themes/bootshop/bootstrap.min.css" media="screen" />
<link href="${contextPath }/themes/css/base.css" rel="stylesheet"
	media="screen" />
<!-- Bootstrap style responsive -->
<link href="${contextPath }/themes/css/bootstrap-responsive.min.css"
	rel="stylesheet" />
<link href="${contextPath }/themes/css/font-awesome.css"
	rel="stylesheet" type="text/css">
<!-- Google-code-prettify -->
<link href="${contextPath }/themes/js/google-code-prettify/prettify.css"
	rel="stylesheet" />
<!-- fav and touch icons -->
<link rel="shortcut icon" href="themes/images/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="${contextPath }/themes/images/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="${contextPath }/themes/images/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="${contextPath }/themes/images/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
	href="${contextPath }/themes/images/ico/apple-touch-icon-57-precomposed.png">
<style type="text/css" id="enject"></style>
   <script type="text/javascript" src="${basePath }/js/jquery-1.7.2.js"></script>
	<script type="text/javascript">
		function valid(){
			var loginName=$("#loginName").val();
			if(""==loginName){
				//TODO
				return false;
			}
			var button=$("button[type=submit]");
			$.ajax({
				url:"${contextPath}/check/"+loginName,
				type:"get",
				success:function(o){
					if(o && o.result){
						console.log("可以登录");
						$("#errTip").hide();
						button.removeAttr("disabled");
					}else{
						console.log("不可以登录");
						$("#loginName").focus();
						button.attr("disabled","true");
						$("#errTip").show();
					}
				},
				error:function(o){
					alert(o);
				}
			});
		}
	</script>

</head>
<body>
	<div id="header">
		<div class="container">
			<div id="welcomeLine" class="row">
				<div class="span6">
					<strong>欢迎来到慧驾书城后台!</strong>
				</div>

			</div>
			<!-- Navbar ================================================== -->
			<div id="logoArea" class="navbar">
				<a id="smallScreen" data-target="#topMenu" data-toggle="collapse"
					class="btn btn-navbar"> <span class="icon-bar"></span> <span
					class="icon-bar"></span> <span class="icon-bar"></span>
				</a>
				<div class="navbar-inner">
					<a class="brand" href="${contextPath }/index"><img
						src="${contextPath }/themes/images/logo.png" alt="Bootsshop" /></a>

					<h2>
						<font color=white>慧驾书城后台管理系统</font>
					</h2>
				</div>
			</div>


		
			<!-- /navbar -->

		</div>
	</div>
	<!-- Header End====================================================================== -->

	<div id="mainBody">
		<div class="container">
			<div class="row">
				<!-- Sidebar ================================================== -->

				<!-- Sidebar end=============================================== -->


		<div class="span12">
			<div class="well">
			<h2></h2>
			<h5>管理员登录</h5>
			
			
			        <c:if test="${errorMsg!=null}">
					 <div class="alert alert-error"  >
        <button type="button" class="close" data-dismiss="alert">&times;</button>

        <strong>错误：</strong> ${errorMsg}

   
      </div>
          </c:if>
      
			<form action="${contextPath }/admin/doAdminLogin" method="post">
			  <div class="control-group">
				<label class="control-label" for="inputLoginName1">登录帐号</label>
				<div class="controls">
				  <input class="span3"  type="text" id="loginName" name="loginName" onblur="valid()" placeholder="登录帐号">
				  
				 <div class="alert alert-error" id="errTip" name="errTip" style="display: none" >
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <strong>登录错误：</strong> 此用户不存在,请重新输入！
      </div>
				</div>
			  </div>
			  <div class="control-group">
				<label class="control-label" for="inputPassword1">账户密码</label>
				<div class="controls">
				  <input type="password" class="span3"  id="inputPassword1" placeholder="用户密码" name="password">
				</div>
			  </div>
			  <div class="control-group">
				<div class="controls">
				  <button type="submit" class="btn">登录</button> 
				</div>
			  </div>
			</form>
		</div>
		</div>
		
				<div class="span12">

							

				</div>
			</div>
		</div>
	</div>
	<!-- Footer ================================================================== -->
	<div id="footerSection">
		<div class="container">

			<p class="pull-right">&copy; 慧驾书城</p>
		</div>
		<!-- Container End -->
	</div>
	<!-- Placed at the end of the document so the pages load faster ============================================= -->
	<script src="${contextPath }/themes/js/jquery.js"
		type="text/javascript"></script>
	<script src="${contextPath }/themes/js/bootstrap.min.js"
		type="text/javascript"></script>
	<script
		src="${contextPath }/themes/js/google-code-prettify/prettify.js"></script>

	<script src="${contextPath }/themes/js/bootshop.js"></script>
	<script src="${contextPath }/themes/js/jquery.lightbox-0.5.js"></script>

	<span id="themesBtn"></span>
</body>
</html>